<template>
  <div id="app">
    <div class="loop">
      <div class="circle"></div>
      <div >
        <div class="bond" v-for="i in 6">
          <div class="box">
            <div class="body"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "name",
  components: {},
  computed:{
    
  },
  mounted(){
     
  },
  data() {
    return {
       
    };
  },
  methods: {
      
  }
};
</script>
<style lang="scss" >
  $bondNum:6;
.loop{
  position: relative;
  width: 600px;
  height: 600px;
  margin: 100px auto;
  border-radius: 100%;
  border: 30px solid #ccc;
  animation: loop 6s linear infinite;
  @keyframes loop {
    100%{
      transform:  rotate(360deg)
    }
  }
  .circle{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    border-radius: 100%;
    width: 120px;
    height: 120px;
    background-color: #ccc;
  }
  .bond{
    position: absolute;
    left: 50%;
    margin-left: -10px;
    height: 300px;
    width: 20px;
    background-color: #ccc;
    transform-origin: 50% 100%;
    @for $i from 1 through $bondNum {
    &:nth-child(#{$i}) {  transform:rotate((360/$bondNum)*($i)+deg); 
    .box{
       transform:rotate(-(360/$bondNum)*($i)+deg);
    }
    }
}
.box{
  position: absolute;
  left: 50%;
  top: -45px;
  margin-left: -45px;
  .body{
  width: 90px;
  height: 90px;
  border-radius: 8px;
  background-color: #999;
  animation: boxrotete 6s linear infinite;
  }
 @keyframes boxrotete {
    100% {transform:rotate(-360deg)}
  }
}
  }
  }
  
</style>
